﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hui</title>
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
    
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.12.0.min.js"></script>
	<script type="text/javascript" src="../script/app.js" ></script>
    <style type="text/css">
    	.user_bj{
    		background:url(../image/user-bj.png) no-repeat;
    		
    		background-size:100% 100%;
    		height:60px;
    	}
    </style>
</head>
<body>
    
    
    <div onclick="$app.openWinByUrl('login','login')" class="H-theme-background-color-497bf0 H-flexbox-horizontal">
	        <div style="padding-left:15px;" class="H-padding-vertical-both-8 H-margin-horizontal-left-10">
	            <img id="portrait" src="../image/logo.png"alt="" title="" class=" H-display-block  H-border-radius-circle H-width-60 H-height-60">
	        </div>
	        <div class="H-flex-item H-margin-10">
	            <div class="H-theme-font-color-999 H-font-size-14 H-flexbox-horizontal H-text-horizontal-left H-box-sizing-border-box">
	                <span class="H-display-block H-flex-item H-text-align-left ">
	                	<span class="H-theme-font-color-black  H-font-size-16 " id="username">登 录</span>
	                	<span class="H-badge H-display-block is_vip">
		            		<span class="H-border-radius-12 vertical-text-top H-padding-vertical-both-3  H-padding-horizontal-both-10 H-theme-background-color976325 H-theme-font-color-white H-font-size-12">体验会员</span>
		            	</span>
		            	
	                </span>
	            </div>
	        </div>
	    </div>
	 
	    
	    <div onclick="" id="login"  class="user_bj H-border-vertical-bottom-after H-padding-vertical-both-15">
	        <div class="H-padding-vertical-both-8 " style="padding-left:50px;width:100px;float: left;">
	            <img src="../image/vip.png" style="border-radius: 5px; width:70px; height:45px;"  class=" H-display-block ">
	        </div>
	        <div class=""  style="width:120px;float: right;margin:8px 40px 0px 0px;">
	            <div class="H-theme-font-color-999 H-font-size-14  H-text-horizontal-left " >
	                <span class="H-display-block H-flex-item H-text-align-left ">
	                	<span class="H-theme-font-color-black H-display-block  H-font-size-14 " id="vip_desc">请开通会员</span>
	                	<span class="H-theme-font-color-black H-display-block  H-font-size-14 " id="vip_end_time">1970-01-01到期</span>
	                </span>
	            </div>
	        </div>
	    </div>
	    
   <!-- <div onclick="" id="login"  class="user_bj H-border-vertical-bottom-after H-padding-vertical-both-15">
	        <div class="H-padding-vertical-both-8 H-width-100-percent">
	            <img id="portrait" src="../image/logo.png" alt="" style="margin:30px auto 10px auto;" class=" H-display-block  H-border-radius-circle H-width-60 H-height-60">
	        </div>
	        <div class="  H-width-100-percent">
	            <div class="H-theme-font-color-999 H-font-size-14 H-flexbox-horizontal H-text-horizontal-left H-box-sizing-border-box">
	                <span class="H-display-block H-flex-item H-text-align-center ">
	                	<span class="H-theme-font-color-black  H-font-size-16 " id="username">登 录</span>
	                </span>
	            </div>
	        </div>
	    </div>-->
			    

    <!--我的资产-->
    <!--<div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-text H-theme-font-color-black H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">我的资产</div>
    </div>
    
    <div class="H-flexbox-horizontal H-text-align-center H-theme-background-color-white H-padding-vertical-both-10">
        <div class="H-flex-item">
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">0</label>
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">优惠券</label>
        </div>
        <div class="H-flex-item">
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">0</label>
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">优惠券</label>
        </div>
        <div class="H-flex-item">
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">0</label>
            <label class="H-display-block H-font-size-13 H-margin-vertical-top-5">余额</label>
        </div>
        
    </div>
    
    -->
    <div class="H-padding-vertical-bottom-10"></div>
    <!--我的服务-->
    <div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-text H-theme-font-color-black H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">我的服务</div>
        <!--<span class="H-icon H-padding-horizontal-right-5 H-display-block"><i class="H-iconfont H-icon-arrow-right H-theme-font-color-ccc H-font-size-14 H-vertical-middle"></i></span>-->
    </div>
    
    <div class="H-n-grid H-border-vertical-top-after H-clear-both H-overflow-auto">
        <div class="H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box">
            <div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-horizontal-right-after H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="openWinByUrlIsLogin('user_info','user_info')">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont"><img  src="../image/user_ico1.png" style="width:24px;height:24px;" /></i></span>
                    <label class="H-display-block H-font-size-14">账户管理</label>
                </div>
            </div>
            <div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="openWinByUrlIsLogin('user_collect','user_collect' )">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont"><img  src="../image/user_ico2.png" style="width:22px;height:22px;" /></i></span>
                    <label class="H-display-block H-font-size-14">观看记录</label>
                </div>
            </div>
            
            <div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-horizontal-right-after H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="_openWinHead('recharge_body','recharge_body' ,'会员购买')">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont"><img  src="../image/user_ico4.png" style="width:24px;height:24px;" /></i></span>
                    <label class="H-display-block H-font-size-14">会员购买</label>
                </div>
            </div>
            <div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="_openWinHead('cards_body','cards_body' ,'卡密充值')">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont"><img  src="../image/user_ico5.png" style="width:22px;height:22px;" /></i></span>
                    <label class="H-display-block H-font-size-14">卡密充值</label>
                </div>
            </div>
        </div>
        

          
            <!--<div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-horizontal-right-after H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="alert('努力开发中')">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont"><img  src="../image/user_ico3.png" style="width:22px;height:22px;" /></i></span>
                    <label class="H-display-block H-font-size-14">邀请奖励</label>
                </div>
            </div>
            <div class="H-display-table-cell H-float-left H-box-sizing-border-box H-width-avg-2 H-center-all H-theme-background-color-white H-border-vertical-bottom-after H-padding-vertical-both-10" style="min-height: 80px;">
                <div onclick="alert('努力开发中')">
                    <span class="H-icon H-display-block H-horizontal-center"><i class="H-iconfont icon-lianxiren1 H-font-size-22 H-vertical-middle"></i></span>
                    <label class="H-display-block H-font-size-14">合作代理</label>
                </div>
            </div>-->
        
    </div>
    <div class="H-padding-vertical-bottom-10"></div>

    
    

	<script>
		apiready =function(){
			api.addEventListener({
	            name:'push_user_info'
            },function(ret,err){
      				
				token = localStorage.getItem('token');
				username = localStorage.getItem('username');
				portrait = localStorage.getItem('portrait');
				if(token !='' && token!=null  && typeof token !='undefined'){
					
					$("#login").attr('onclick','');
					
					if(username !='' && username!=null  && username!='undefined'){
						$("#username").html(username);
						$("#username").show();
					}else{
						$("#username").html('登录');
					}
					
					if(portrait !='' && portrait!=null  && portrait!='undefined'){
						$("#portrait").attr('src',portrait);
					}else{
						
						$("#portrait").attr('src',"../image/a9.jpg");
					}
					
					userInfo = $api.getStorage('userinfo');
				
					if( userInfo.vip == 1){
						$(".is_vip").show();
						$(".is_vip span").text('体验会员');
						$("#vip_desc").text( "当前为体验会员" );
						
					} else if( userInfo.vip == 2){
						$(".is_vip").show();
						$(".is_vip span").text('钻石会员');
						$("#vip_desc").text( "已开通钻石会员" );
						
					} else {
						$(".is_vip").hide();
						$("#vip_desc").text( "请开通会员" );
					}
					$("#vip_end_time").text(   _formatDate(userInfo.vip_end_time *1000) + " 到期"  );
						
						
				}else{
					$("#login").attr('onclick','login()');
					$("#username").html('登录');
					$("#portrait").attr('src',"../image/a9.jpg");
					
					$(".is_vip").hide();
						$("#vip_desc").text( "请开通会员" );
						$("#vip_end_time").text(  "1970-01-01 到期"  );
				}
				
				
						
				
            });
			
			token = localStorage.getItem('token');
			username = localStorage.getItem('username');
			portrait = localStorage.getItem('portrait');
			if(token !='' && token!=null  && typeof token !='undefined'){
				
				$("#login").attr('onclick','');
				
				if(username !='' && username!=null  && username!='undefined'){
					$("#username").html(username);
					$("#username").show();
				}else{
					$("#username").html('登录');
				}
				
				if(portrait !='' && portrait!=null  && portrait!='undefined'){
					$("#portrait").attr('src',portrait);
				}else{
					
					$("#portrait").attr('src',"../image/a9.jpg");
				}
				
				
				userInfo = $api.getStorage('userinfo');
				
				if( userInfo.vip == 1){
					$(".is_vip").show();
					$(".is_vip span").text('体验会员');
					$("#vip_desc").text( "当前为体验会员" );
					
				} else if( userInfo.vip == 2){
					$(".is_vip").show();
					$(".is_vip span").text('钻石会员');
					$("#vip_desc").text( "已开通钻石会员" );
					
				} else {
					$(".is_vip").hide();
					$("#vip_desc").text( "请开通会员" );
				}
				$("#vip_end_time").text(   _formatDate(userInfo.vip_end_time *1000) + " 到期"  );
			}else{
				$(".is_vip").hide();
				$("#login").attr('onclick','login()');
			}
			
			
			
			
				
			
			
			
		}
		
		
		function login(){
			$app.openWinByUrl('login','login')
		}
		
		function _openWinHead(name,url,title){
			token = localStorage.getItem('token');
			if(token !='' && token!=null  && token!='undefined'){
				$app.bounces = false;
				$app.openWinByUrl(name+'win_head','./win_head',{'fname':name,'furl':url,'title':title});
			}else{
				login();
			}
			
			
		}
		
		function openWinByUrlIsLogin(name,url){
			uid = localStorage.getItem('token');
			if(uid !='' && uid!=null  && uid!='undefined'){
				
				$app.openWinByUrl(name,url)
			}else{
				login();
			}
			
			
		}
	</script>
</body>
</html>